#include <stdio.h>
int main()
{	  	 	 	  
    int a, b, c, count = 0; //1

    for (a = 1; a <= 9; a++)	//1
    {	  	 	 	  
        for (b = 0; b <= 9; b++)	//1
        {	  	 	 	  
            for (c = 0; c <= 9; c++)	//1
            {	  	 	 	  
                if (a != b && a != c && b != c && c % 2 == 0)	//2
                {	  	 	 	  
                    count++;  //1
                }
            }
        }
    }
    printf("%d\n", count);   //1
    return 0;

}	 
